import { _decorator, Component, Node } from 'cc';
import { DEV } from 'cc/env';
const { ccclass, property } = _decorator;

@ccclass('FrontCardBase')
export class FrontCardBase extends Component {

    @property({ displayName: DEV && '正反显示隐藏', type: Node })
    protected cardNode: Node | null = null;

    @property({ displayName: DEV && '反面', type: Node })
    protected backCardNode: Node | null = null;

    @property({ displayName: DEV && '正面', type: Node })
    protected frontCardNode: Node | null = null;

    // 初始化
    protected init() {
        
        // this.hide(); // 隐藏

        // 重置
        this.frontCardNode.active = false;
        this.backCardNode.active = true;
    }

    protected onLoad() {
        this.init();
    }

    // 展示
    public show() {
        this.cardNode.active = true;
    }

    // 隐藏
    public hide() {
        this.cardNode.active = false;
    }

    // 翻到正面
    public flipToFront(): Promise<void> {
        return null
    }

    // 翻到反面
    public flipToBack(): Promise<void> {
        return null
    }

}


